package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;
import java.util.Objects;

@Entity
public class Zchuku {
    private int chukuId;
    private Zdelivery deliveryId;
    private TfyclientForm clientId;
    private String chukuNo;
    private String chukuCanku;
    private Timestamp chukuTime;
    private String chukuShifouth;
    private String chukuFuzeren;
    private String chukuFahuo;
    private List<Zchukuxq> xq;

    @Id
    @Column(name = "chuku_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getChukuId() {
        return chukuId;
    }

    public void setChukuId(int chukuId) {
        this.chukuId = chukuId;
    }

    @ManyToOne
    @JoinColumn(name = "client_id", referencedColumnName = "client_id")
    public TfyclientForm getClientId() {
        return clientId;
    }

    public void setClientId(TfyclientForm clientId) {
        this.clientId = clientId;
    }

    @ManyToOne
    @JoinColumn(name = "delivery_id", referencedColumnName = "delivery_id")
    public Zdelivery getDeliveryId() {
        return deliveryId;
    }

    public void setDeliveryId(Zdelivery deliveryId) {
        this.deliveryId = deliveryId;
    }

    @OneToMany(mappedBy = "chukuId")
    public List<Zchukuxq> getXq() {
        return xq;
    }

    public void setXq(List<Zchukuxq> xq) {
        this.xq = xq;
    }

    @Basic
    @Column(name = "chuku_no", nullable = true, length = 200)
    public String getChukuNo() {
        return chukuNo;
    }

    public void setChukuNo(String chukuNo) {
        this.chukuNo = chukuNo;
    }

    @Basic
    @Column(name = "chuku_canku", nullable = true, length = 200)
    public String getChukuCanku() {
        return chukuCanku;
    }

    public void setChukuCanku(String chukuCanku) {
        this.chukuCanku = chukuCanku;
    }

    @Basic
    @Column(name = "chuku_fahuo", nullable = true, length = 200)
    public String getChukuFahuo() {
        return chukuFahuo;
    }

    public void setChukuFahuo(String chukuFahuo) {
        this.chukuFahuo = chukuFahuo;
    }

    @Basic
    @Column(name = "chuku_time", nullable = true)
    public Timestamp getChukuTime() {
        return chukuTime;
    }

    public void setChukuTime(Timestamp chukuTime) {
        this.chukuTime = chukuTime;
    }

    @Basic
    @Column(name = "chuku_shifouth", nullable = true, length = 255)
    public String getChukuShifouth() {
        return chukuShifouth;
    }

    public void setChukuShifouth(String chukuShifouth) {
        this.chukuShifouth = chukuShifouth;
    }

    @Basic
    @Column(name = "chuku_fuzeren", nullable = true, length = 255)
    public String getChukuFuzeren() {
        return chukuFuzeren;
    }

    public void setChukuFuzeren(String chukuFuzeren) {
        this.chukuFuzeren = chukuFuzeren;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Zchuku zchuku = (Zchuku) o;
        return chukuId == zchuku.chukuId &&
                Objects.equals(deliveryId, zchuku.deliveryId) &&
                Objects.equals(chukuCanku, zchuku.chukuCanku) &&
                Objects.equals(chukuTime, zchuku.chukuTime) &&
                Objects.equals(chukuShifouth, zchuku.chukuShifouth) &&
                Objects.equals(chukuFuzeren, zchuku.chukuFuzeren);
    }

    @Override
    public int hashCode() {
        return Objects.hash(chukuId, deliveryId, chukuCanku, chukuTime, chukuShifouth, chukuFuzeren);
    }

    @Override
    public String toString() {
        return "Zchuku{" +
                "chukuId=" + chukuId +
                ", deliveryId=" + deliveryId +
                ", clientId=" + clientId +
                ", chukuNo='" + chukuNo + '\'' +
                ", chukuCanku='" + chukuCanku + '\'' +
                ", chukuTime=" + chukuTime +
                ", chukuShifouth='" + chukuShifouth + '\'' +
                ", chukuFuzeren='" + chukuFuzeren + '\'' +
                ", xq=" + xq +
                '}';
    }
}
